package com.easy.project.base.validate;

import com.easy.project.base.constant.IBaseEnumParam;
import com.easy.project.base.validate.validator.EnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 枚举验证器
 * @author wxz
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy ={EnumValidator.class})
public @interface EnumValidate {

    /**
     * 枚举的集合
     * @return
     */
    String[] enums() default {};

    /**
     * baseEnum
     * @return
     */
    Class<? extends IBaseEnumParam<?>> baseEnum();

    String message() default "枚举错误";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
